#! /usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Kei Okada.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#  * Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above
#    copyright notice, this list of conditions and the following
#    disclaimer in the documentation and/or other materials provided
#    with the distribution.
#  * Neither the name of Kei Okada nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.


PACKAGE='hough_circles'

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()
gen.add("use_camera_info", bool_t, 0, "Indicates that the camera_info topic should be subscribed to to get the default input_frame_id. Otherwise the frame from the image message will be used.", True)

gen.add("canny_threshold", double_t, 0, "Canny threshold", 200, 1, 255)
gen.add("accumulator_threshold", double_t, 0, "Accumulator threshold", 50, 1, 200)

gen.add("gaussian_blur_size", int_t, 0, "the size of gaussian blur (should be odd number)", 9, 1, 30)
gen.add("gaussian_sigma_x", double_t, 0, "sigma x of gaussian kernel", 2, 1, 10)
gen.add("gaussian_sigma_y", double_t, 0, "sigma y of gaussian kernel", 2, 1, 10)
gen.add("min_distance_between_circles", double_t, 0, "mnimum distance between the centers of the detected circles", 0, 0, 1024)
gen.add("dp", double_t, 0, "dp", 2, 0, 100)
gen.add("min_circle_radius", int_t, 0, "the minimum size of the circle", 0, 0, 500)
gen.add("max_circle_radius", int_t, 0, "the maximum size of the circle", 0, 0, 2000)

debug_view_type_enum = gen.enum([ gen.const("Input", int_t, 0, "Input image"),
                                  gen.const("Blur", int_t, 1, "GaussianBlur image"),
                                  gen.const("Canny", int_t, 2, "Canny edge image"),
                              ],
                                "An enum for debug view")

gen.add("debug_image_type", int_t, 0, "Select image type for debug output", 0, 0, 2, edit_method=debug_view_type_enum)

exit(gen.generate(PACKAGE, "hough_circles", "HoughCircles"))
